var require, _, Backbone, console;

// Configure RequireJS
require.config({
    // Alias the library imports to shorter names
    paths: {
        domReady: "libs/domReady",
        jquery: "libs/jquery-1.8.0.min",
        "jquery-ui": "libs/jquery-ui-1.8.23.custom.min",
        "jquery-template": "libs/jquery.tmpl.min",
        "jquery-editable": "libs/jquery.jeditable.mini",
        "jquery-wysiwyg": "libs/jquery.wysiwyg",
        "jquery-editable-wysiwyg": "libs/jquery.jeditable.wysiwyg",
        "jquery-tinymce" : "libs/tiny_mce/jquery.tinymce"
    },
    // Give RequireJS names to global variables loaded from the non AMD 
    // libraries at the (aliased) paths listed as keys. These key names expand
    // to the values given in the paths config section.
    shim: {
        jquery: {
            exports: "$"
        },
        "jquery-ui" : {
        	deps : ["jquery"]
        }
    }
});

require(
        ["jquery", "domReady", "editable", "jquery-template"],
 // main.js's entry point.
 function($) {
   "use strict";
    var page_module = $("script[src$='require.js']").attr("data-page-module");
    if(!page_module) {
        console.log("No value for attribute data-page-module provided on " + 
                "require.js's script tag.");
        return;
    }

    console.log("Loading entry point:", page_module);
    // Load the module defined as the page's entry point.
    window.setTimeout(function() {
        require([page_module], function(page_module) {
        	  // that should be enough to get it loaded.
           });
        },10);
});
